//
//  RealEstateQaViewController.m
//  RealEstateQa
//
//  Created by 张立彬 on 13-7-9.
//  Copyright (c) 2013年 com.rong360. All rights reserved.
//

#import "nextViewController.h"
#import "configViewController.h"
#import "DrawView.h"
#import "qaViewController.h"


@interface nextViewController ()

@end

@implementation nextViewController

@synthesize  rc;

@synthesize  TableList;

@synthesize  TableQa;

@synthesize ScrollBody;


//标题
@synthesize DataTitle;
//标题列表
@synthesize DataTitleList;

//描述
@synthesize DataDesc;
//描述列表
@synthesize DataDescList;

//列表数据
@synthesize DataList;
@synthesize DataListList;

//问答列表
@synthesize DataQa;
@synthesize DataQaList;

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    //cIndex = 0;
    
    //[self getData];
    
    [self initQa];
    [self initTable];
    
    //声明DrawView类
    Dv = [[DrawView alloc]init];
    
    //wrap = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
    
    BOOL isIpone5 =   [UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(320*2, 568*2),[[UIScreen mainScreen] currentMode].size) : NO;
    if(isIpone5){
        wrap = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 550)];
    }else{
        wrap = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
    }
    
    [self.view addSubview:wrap];
    
    //[wrap addSubview:TableList];
    
     //初始化滚动区
     [Dv DrawView:wrap
     title:DataTitle
     desc:DataDesc
     table: TableList
     qa: TableQa
     ];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//隐藏navbar
-(void)viewWillAppear:(BOOL)animated
{
	[super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
}


//初始化表格
-(void)initTable{
    //加载表格
    //TableList = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
    TableList.hidden = NO;
    TableList.delegate = rc;
    TableList.dataSource = rc;
    TableList.scrollEnabled = NO;
    //构造模拟数据
    TableList.layer.borderWidth = 1;
    TableList.layer.borderColor =  [[UIColor colorWithRed:(219/255.0) green:(225/255.0) blue:(228/255.0) alpha:1] CGColor];
    
}
//初始化表格
-(void)initQa{
    //加载表格
    //TableQa = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
    TableQa.delegate = rc;
    TableQa.dataSource = rc;
    TableQa.scrollEnabled = NO;
    //构造模拟数据
    TableQa.layer.borderWidth = 0;
    
    //表格背景透明
    TableQa.backgroundView = nil;
    TableQa.backgroundColor = [UIColor clearColor];
    TableQa.opaque = NO;
}

@end
